package com.eleven.mall.controller;

import com.eleven.mall.pojo.ManagerPage;
import com.eleven.mall.pojo.Rbody;
import com.eleven.mall.pojo.RoleOut;
import com.eleven.mall.service.RoleService;
import lombok.AllArgsConstructor;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @Auther: Rui_simple
 * @Date: 2022/10/26 10:25
 * @Description: RoleController
 * @Version 1.0.0
 */
@RestController
@AllArgsConstructor
@CrossOrigin
public class RoleController {
    RoleService roleService;

    @GetMapping("/roles")
    public Rbody getRoleList(){
        Rbody rbody = new Rbody();
        List<RoleOut> roleOut = roleService.getRoleList();
        //System.out.println(roleOut);
        rbody.getMeta().setMsg("获取成功");
        rbody.setData(roleOut);
        return rbody;
    }
}
